if(!localStorage.getItem('nav')) {
    localStorage.setItem('nav', '1')
}

function setCurrentNav(index) {
    localStorage.setItem('nav', `${index}`);
    let navContainers = document.querySelectorAll('.nav-container');
    navContainers.forEach(function(nav) {
        nav.classList.remove('nav-container-active');
    });
    document.getElementById('nav-' + index).classList.add('nav-container-active');
}

document.addEventListener("DOMContentLoaded", ()=>{
    let index = localStorage.getItem('nav')
    let navContainers = document.querySelectorAll('.nav-container');
    navContainers.forEach(function(nav) {
        nav.classList.remove('nav-container-active');
    });
    document.getElementById(`nav-${index}`).classList.add('nav-container-active');
})
